Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GH-14290: Member access within null pointer in extension spl #14292

Closed
wants to merge 1 commit into from

Conversation

nielsdos
Copy link
Member

php_pcre_replace_impl() can fail and return NULL. We should take that error condition into account. Because other failures return false, we return false here as well.

At first, I also thought there was a potential memory leak in the error check of replacement_str, but found that the error condition can never trigger, so replace that with an assertion.

php_pcre_replace_impl() can fail and return NULL. We should take that
error condition into account. Because other failures return false, we
return false here as well.

At first, I also thought there was a potential memory leak in the error
check of replacement_str, but found that the error condition can never
trigger, so replace that with an assertion.
@nielsdos nielsdos requested a review from Girgias as a code owner May 21, 2024 17:43
@nielsdos nielsdos linked an issue May 21, 2024 that may be closed by this pull request
Copy link
Member

@devnexen devnexen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LCTM little nit: not related but for consistency sake line 1934 can be updated too

@nielsdos nielsdos closed this in b3a56bd May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Member access within null pointer in extension spl
2 participants